using Common.Model;
using FluentNHibernate.Mapping;

namespace Common.Mappings
{
    public class TrainingCourseMapping:ClassMap<TrainingCourse>
    {
        public TrainingCourseMapping()
        {
            Id(t => t.Id);
            Map(t => t.OpenDate);
            Map(t => t.CloseDate);
            Map(t => t.Duration);
            References(t => t.TrainingClass, "TrainingClassId").Not.LazyLoad();
            References(t => t.Observation, "ObservationId").Not.LazyLoad();
            References(t => t.Trainer, "TrainerId").Not.LazyLoad();

            //References(t => t.ObservationEmployee);//.ForeignKey("Observation");
            //HasOne(t => t.Observation).ForeignKey();
           // HasOne(t => t.TrainerEmployee).ForeignKey("Trainer");
            //References(t => t.TrainingClass, "TrainingClassId").Not.Nullable();
        }
    }
}